import React, { Component } from 'react';
import { Scene, Actions, Stack } from 'react-native-router-flux';
import { Text } from 'react-native';
import Icon from 'react-native-vector-icons/FontAwesome';
import navBarStyle from '../../components/navBarStyle';
import Login from './login';
import Start from './start';
import Ready from './ready';
import Protocol from './protocol';
import TestForm from './testForm';
import user from '../../common/models/user';
import { file0,file1 } from "./protocolText";

// const WeixinBtn = (
//   <Text onPress={user.wxAuth.bind(user)} style={{ paddingRight: 10, color: '#62b900' }}>
//     <Icon name="weixin" color="#62b900" size={16} style={{ marginRight: 4 }} />
//     <Text>微信登录</Text>
//   </Text>
// );

module.exports = (
  <Stack key="start">
    <Scene
      key="readyPage"
      component={Ready}
      title="开始"
      path="/ready"
      hideNavBar
    />
    <Scene
      key="login"
      component={props => <Login {...props} user={user} />}
      title="使用手机号登录"
      path="/login"
      {...navBarStyle}
    />
    <Scene
      key="privacy"
      component={props => <Protocol {...props} user={user} />}
      title="隐私策略"
      path="/protocol"
      file0={file1}
      {...navBarStyle}
    />
    <Scene
      key="protocol"
      component={props => <Protocol {...props} user={user} />}
      title="用户协议"
      path="/protocol"
      file0={file0}
      {...navBarStyle}
    />
    <Scene
      key="startPage"
      component={props => <Start {...props} user={user} />}
      title="开始"
      path="/start"
      hideNavBar
      initial
      onEnter={user.checkWechat.bind(user)}
    />
    <Scene
      key="testForm"
      component={TestForm}
      title="表单测试"
      path="/test"
      // initial
    />
  </Stack>
);
